<template>
    <div>
        <div class="weekend-title">周末去哪儿</div>
        <ul class="weekend">
            <!-- 一像素边框的解决方案 -->
            <li class="item border-bottom" v-for="item of list" :key="item.id">
                <div class="item-img-wrapper">
                    <img class="item-img" :src="item.imgUrl" />
                </div>
                <div class="item-info">
                    <p class="item-title">{{item.title}}</p>
                    <p class="item-desc">{{item.desc}}</p>
                    
                </div>
            </li>
        </ul>
    </div>
</template>
<script>
export default {
    name: "HomeWeekend",
    props: {
        list: Array
    },
    data () {
        return {
            weekendList: [{
                id:"0001",
                imgUrl:"https://imgs.qunarzz.com/sight/p0/1412/9f/fbff2a5302c0ce906ef9b64159730f89.water.jpg_224x148_4524dfdc.jpg",
                title:"上海海洋水族馆",
                desc:"穿越世界，来一次终生难忘的海洋之旅"
            },{
                id:"0002",
                imgUrl:"https://imgs.qunarzz.com/sight/p0/1412/9f/fbff2a5302c0ce906ef9b64159730f89.water.jpg_224x148_4524dfdc.jpg",
                title:"上海海洋水族馆",
                desc:"穿越世界，来一次终生难忘的海洋之旅"
            },
            {   id:"0003",
                imgUrl:"https://imgs.qunarzz.com/sight/p0/1412/9f/fbff2a5302c0ce906ef9b64159730f89.water.jpg_224x148_4524dfdc.jpg",
                title:"上海海洋水族馆",
                desc:"穿越世界，来一次终生难忘的海洋之旅"
            }]
        }
    }
}
</script>

<style lang="stylus" scoped>
    @import '~styles/mixins.styl'
    // 以下css样式是跟着视频打的。。
    .weekend-title
        margin-top: .1rem
        line-height: .8rem
        background: #eee
        text-indent: .2rem

    .item-img-wrapper
        overflow: hidden
        padding-bottom: 37.09%
        height: 0        
        .item-img
            width: 100%
    .item-info
    
        padding: .1rem
        // 加了这句下面的ellipsis才会生效
        min-width: 0
        .item-title
            line-height: .54rem
            font-size: .32rem
            ellipsis()
        .item-desc
            line-height: .4rem
            color: #ccc
            ellipsis()
 
</style>

